﻿using NPOI.SS.Formula.Functions;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DFGK_WMS.Model.Models
{
    /// <summary>
    /// 物料
    /// </summary>
    [Table("TMaterials")]
    [SugarTable("TMaterials")]
    public partial class TMaterial
    {
        /// <summary>
        /// 物料Id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 物料号
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 型号规格
        /// </summary>
        public string ModelSpec { get; set; }
        /// <summary>
        /// 货主Id
        /// </summary>
        [SugarColumn(IsIgnore =true)]
        public int? OwnerId { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string OwnerName { get; set; }
        /// <summary>
        /// 物料类型Id
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int TypeId { get; set; }
        public string TypeCode { get; set; }
        /// <summary>
        /// 物料类型
        /// </summary>
        public string TypeName { get; set; }
        public string FullTypeIds { get; set; }
        public string FullTypeNames { get; set; }
        /// <summary>
        /// 基本单位Id
        /// </summary>
        public int? UnitId { get; set; }
        /// <summary>
        /// 基本单位(物料单位)
        /// </summary>
        public string UnitName { get; set; }

        /// <summary>
        /// 单位编码(学校新增字段)
        /// </summary>
        public string UnitCode { get; set; }
        /// <summary>
        /// 毛重
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? GrossWeight { get; set; }
        /// <summary>
        /// 净重
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? NetWeight { get; set; }
        /// <summary>
        /// 毛重重量单位Id
        /// </summary>
        public int? GrossWeightUnitId { get; set; }
        /// <summary>
        /// 毛重重量单位
        /// </summary>
        public string GrossWeightUnitName { get; set; }
        /// <summary>
        /// 净重重量单位Id
        /// </summary>
        public int? NetWeightUnitId { get; set; }
        /// <summary>
        /// 净重重量单位
        /// </summary>
        public string NetWeightUnitName { get; set; }
        /// <summary>
        /// 体积
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? Volum { get; set; }
        /// <summary>
        /// 体积单位Id
        /// </summary>
        public int? VolumUnitId { get; set; }
        /// <summary>
        /// 体积单位
        /// </summary>
        public string VolumUnitName { get; set; }
        /// <summary>
        /// 最小安全库存
        /// </summary>
        public int? MinSafetyStock { get; set; }
        /// <summary>
        /// 最大安全库存
        /// </summary>
        public int? MaxSafetyStock { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 创建人Id
        /// </summary>
        public int? CreateUserId { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUserName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// 修改用户Id
        /// </summary>
        public int? ModifyUserId { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>
        public string ModifyUserName { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? ModifyDate { get; set; }

        /// <summary>
        /// 物料图
        /// </summary>
        public string Img { get; set; }

        /// <summary>
        /// 物料分类Id
        /// </summary>
        public int? MaterialCategoryId { get; set; }

        /// <summary>
        /// 是否有货号详情(是否有资产明细)
        /// </summary>
        public bool? HasSkuDetail { get; set; }

        /// <summary>
        /// 物料组Id
        /// </summary>
        public int? MaterialGroupId { get; set; }

        /// <summary>
        /// 是否充电
        /// </summary>
        public bool? IsNeedCharging { get; set; }

        /// <summary>
        /// 保质期（单位月份）
        /// </summary>
        public int? ExpirationMonth { get; set; }

        /// <summary>
        /// 物料分类名称
        /// </summary>
        public string? MaterialCategoryName { get; set; }

        /// <summary>
        /// 是否可以拆卸
        /// </summary>
        public bool? IsDismantle { get; set; }

        /// <summary>
        /// 预警天数
        /// </summary>
        public int? WarningDays { get; set; }

        /// <summary>
        /// 当前登陆人Id
        /// </summary>
        [NotMapped]
        [SugarColumn(IsIgnore =true)]
        public int NowUserId { get; set; }

        /// <summary>
        /// 当前登陆人真实姓名
        /// </summary>  
        [NotMapped]
        [SugarColumn(IsIgnore = true)]
        public string NowUserRealName { get; set; }
        #region 西安煤科院
        /// <summary>
        /// 物料类型描述
        /// </summary>
        public string MaterialTypeDesc { get; set; }
        /// <summary>
        /// 物料组
        /// </summary>
        public string MaterialGroupCode { get; set; }

        /// <summary>
        /// 物料组名称
        /// </summary>
        public string MaterialGroupName { get; set; }
        /// <summary>
        /// 长度
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Length { get; set; }
        /// <summary>
        /// 宽度
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Width { get; set; }
        /// <summary>
        /// 高度
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Height { get; set; }
        /// <summary>
        /// 长宽高基本单位
        /// </summary>
        public string Unit { get; set; }
        #endregion
    }
}
